import React, { PureComponent } from 'react';
import { connect } from 'dva';
import Link from 'umi/link';

import Exception from './index';

class NotAuthorized extends PureComponent {
    render() {
        const { global, loading } = this.props;

        return (
            loading ? null : <Exception type={403} style={{ minHeight: 800, height: '80%' }} linkElement={Link} to={global.originUrl ? global.originUrl : '/platform'} />
        );
    }
}

export default connect(({ global, loading }) => ({ global, loading: loading.effects['global/fetchMenu'] }))(NotAuthorized);

